home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows News 2005 November
/
WNnov2005.iso
/
Windows
/
Indispensables
/
Movie Collection
/
MovieCollection5403.exe
/
{app}
/
php5
/
film.php
next >
Wrap
PHP Script
|
2005-03-03
|
1KB
|
47 lines
<?php
include_once('sql.class.php');
include_once('replace.class.php');
include_once('tools.class.php');
$mcsql= new TmcSql();
$doc = new DOMDocument();
$node = createDataPacket($doc);
$datapacket=$node;
// DonnΘes du films
$node = $doc->createElement('columns');
$rootnode = $node;
$tab = $mcsql->openSql('select * from t_film where idx='.$_GET["idx"]);
foreach ($tab as $key => $row)
{
foreach ($row as $k => $val)
{
if (!is_numeric($k))
{
$node = $doc->createElement('column');
$node->setAttribute("field", strtolower($k));
$node->setAttribute("value", utf8_encode($val));
$node->setAttribute("caption", $k);
$rootnode->appendChild($node);
}
}
}
$datapacket->appendChild($rootnode);
$xsl = new DomDocument;
$xsl->load('./film.xsl');
$xsl_srce = $xsl->saveXML();
$replace = new TmcXslReplace($xsl_srce);
$xsl_srce = $replace->processReplace();
$xsl->loadxml($xsl_srce);
$proc = new xsltprocessor();
$proc->importStyleSheet($xsl); // Importation des rΦgles XSL
echo $proc->transformToXML($doc); // Transformation
//print $doc->saveXML();
?>